def get_avg_ratio(numbers):
    avg = sum(numbers) / len(numbers)
    scaled = [x / avg for x in numbers]
    scaled.sort(reverse=True)
    return scaled


lengths = [64, 62, 74, 63, 77, 71, 64, 71, 68, 65]

longest, *middle, shortest = get_avg_ratio(lengths)

print(f"longest: {longest:>4.0%}, shortest: {shortest:>4.0%}")
